#!/usr/bin/env ruby

# You might want to change this
ENV["RAILS_ENV"] ||= "development"

require File.dirname(__FILE__) + "/../../config/environment"
#Rails.application.require_environment!

$running = true
Signal.trap("TERM") do 
  $running = false
end

while($running) do
  
  # Replace this with your code
  Rails.logger.auto_flushing = true
  #algorithm = Algorithm.first
  #algorithm.run_algorithm
  :run_algorithm
  #Rails.logger.info "This daemon is still running when this gets writ.\n"
  
  sleep 10
end